package edu.asu.sapa.ground.update;

import edu.asu.sapa.Planner;
import edu.asu.sapa.ground.State;

public class InterimIntervalLoader extends Load {

	public InterimIntervalLoader(Update[] contents) {
		super(contents);
	}
	
	@Override
	public final boolean load(State s, Context c) {
		float t = c.start;
		float f = c.finish;
//		for (Update u : contents) {
//			s.events.add(c,u,UpdateWrapper.StartAfter,t);
//			s.events.add(c,u,UpdateWrapper.FinishBefore,f);
//		}
		s.events.add(c,this,UpdateWrapper.StartAfter,t);
		s.events.add(c,this,UpdateWrapper.FinishBefore,f);
		return true;
	}
	
	public final boolean applicable(State s, Context c) {
		return true;
	}
	
	public String toString() {
		return "\t(over all " + super.toString();
	}

}
